/*
 * Su-yun Information Technology, Co.,Ltd CONFIDENTIAL
 *
 * (C) Copyright Su-yun Information Technology, Co.,Ltd. 2021 All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains the property of
 * Su-yun Information Technology, Co.,Ltd. The intellectual property herein
 * are protected by trade secret, patent law or copyright law. Dissemination
 * of this information or reproduction of this material is strictly forbidden
 * unless prior written permission is obtained from Su-yun Information Technology.
 *
 * https://suyunplat.com/
 *
 */
package com.xtiim.battery.discharge.protocal;

import com.xtiim.battery.discharge.util.TimeUtil;
import lombok.Getter;
import lombok.ToString;

import java.util.Arrays;
import java.util.Date;

/**
 * Battery inspect record
 *
 */
@ToString
public class InspectRecord {
    private int host;

    /**
     * Battery indicator data record.
     *
     */
    @Getter
    public static class BatteryDataRecord extends InspectRecord {
        private int voltType;
        private int line;
        private Date time;
        private double[] volts;

        public BatteryDataRecord(int voltType, int line, Date time, double[] volts) {
            this.voltType = voltType;
            this.line = line;
            this.time = time;
            this.volts = volts;
        }

        @Override
        public String toString() {
            return new StringBuilder()
                    .append("voltType: " + voltType + ", ")
                    .append("line: " + line + ", ")
                    .append("time: " + TimeUtil.dateToStr(time))
                    .append("volts: " + Arrays.toString(volts) + ", ")
                    .append("]").toString();
        }
    }
}
